<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout 后台大布局 - Layui</title>
<link rel="stylesheet" href="/layui-v2.0.1/layui/css/layui.css">
<link rel="stylesheet" href="/css/admin.css">

</head>
<body>

<div class="layui-layout layui-layout-admin">
  @include('admin.header')
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
       @include('admin.leftadmin')
    </div>
  </div>
  
  <div class="layui-body">
   <div class="layui-body" style="padding-top: 20px;">
    <div class="layui-form-item">
      <label class="layui-form-label">账号</label>
      <div class="layui-input-inline">
        <input type="text" name="username" lay-verify="pass" value="" autocomplete="off" class="layui-input username">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">密码</label>
      <div class="layui-input-inline">
        <input type="text" name="password" lay-verify="pass" value="" autocomplete="off" class="layui-input password">
      </div>
    </div>
    <button class="layui-btn" lay-submit="" lay-filter="" style="margin-left:110px">添加</button>    

  </div>
  </div>
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="/layui-v2.0.1/layui/layui.js"></script>
<script>
layui.use(['layer','jquery'], function(){
  var $ = layui.jquery;
  $(function(){
    $('.layui-btn').click(function(){
    var ad = $('.admin_ad').val();
    var username = $('.username').val();
    var password = $('.password').val();
    if(username==""||password==""){
      layer.msg('用户名和密码必填!');
    }else{
      $.ajax({
        url:"/admin/admin/doaddoper",
        type:'post',
        data:{'username':username,'password':password,'ad':ad},
        dataType:'json',
        success:function(d){
          if(d.code==20){           
           // window.location.reload();
            layer.msg(d.msg);
          }else{
            layer.msg(d.msg);
          }
        }
      })
     }
    })
   })
  })

  layui.use(['element','form'], function(){
    var element = layui.element;
    var form = layui.form
  
});
</script>












